package com.freshmarket.freshmarket.controller;


import com.freshmarket.freshmarket.controller.form.InsertProductBatchForm;
import com.freshmarket.freshmarket.service.impl.ProductBatchServiceImpl;
import com.freshmarket.freshmarket.utils.Result;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.sql.ResultSet;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Squirrel
 * @since 2020-09-05
 */
@RestController
@RequestMapping("/freshmarket/product-batch")
public class ProductBatchController {

    final ProductBatchServiceImpl productBatchService;

    public ProductBatchController(ProductBatchServiceImpl productBatchService) {
        this.productBatchService = productBatchService;
    }

    @RequestMapping("/insertProductBatch")
    public Result insertProductBatch(@Valid InsertProductBatchForm insertProductBatchForm){
        productBatchService.insertProductBatch(insertProductBatchForm);
        return Result.successResult();
    }

    @RequestMapping("/putDownProductBatch")
    public Result putDownProductBatch(int productBatchId){
        productBatchService.putDownProductBatch(productBatchId);
        return Result.successResult();
    }

}

